local jintang = fk.CreateSkill({
    name = "sj6__jintang",
    tags = {Skill.Compulsory},
  })
  
  Fk:loadTranslationTable{
    ["sj6__jintang"] = "金汤",
    [":sj6__jintang"] = "<b>锁定技</b>，你造成伤害后或受到伤害时，摸一张牌并弃置X张手牌（X为你本回合造成的伤害数，不足改为摸）。",
  
    ["@sj6__jintang-turn"] = "金汤",

   ["$sj6__jintang1"] = "",
   ["$sj6__jintang2"] = "",
  }

  local jintang_spec = {
    anim_type = "drawcard",
    can_trigger = function(self, event, target, player, data)
      return target == player and player:hasSkill(jintang.name)
     end,
     on_use = function(self, event, target, player, data)
      player:drawCards(1,jintang.name)
      local n = player:getMark("@sj6__jintang-turn")
      if n == 0 then return end
      if player:getHandcardNum() >= n then
        player.room:askToDiscard(player,{
          min_num = n,
          max_num = n,
          include_equip = false,
          cancelable = false,
          skill_name = jintang.name,
        })
      else
        player:drawCards(n,jintang.name)
      end
    end,
  }

  jintang:addEffect(fk.Damage, jintang_spec)
  jintang:addEffect(fk.DamageInflicted, jintang_spec)

  jintang:addEffect(fk.Damage, {
    can_refresh = function(self, event, target, player, data)
      return target == player and player:hasSkill(jintang.name,true)
      end,
    on_refresh = function(self, event, target, player, data)
      player.room:addPlayerMark(player,"@sj6__jintang-turn",data.damage)
    end,
  })

  return jintang